package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Dlluser entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "DLLUSER", schema = "MANAGER", uniqueConstraints = {})
public class Dlluser implements java.io.Serializable {

	// Fields

	private String usrcodigo;
	private Bodega bodega;
	private String usrnombre;
	private String usrpasswd;
	private String usrperfil;
	private Date usrfecnace;
	private Date usrfeccamb;
	private Long usrdiasven;
	private String usrpassint;
	private String usrbodega;
	private Long usractivo;
	private String usrbodaut;
	private String usrtdcaut;
	private Timestamp usrlogfec;
	private Dlluser dlluser;
	private Set<RequiDoc> requiDocs = new HashSet<RequiDoc>(0);
	private Set<Mngdoc> mngdocs = new HashSet<Mngdoc>(0);

	// Constructors  

	/** default constructor */
	public Dlluser() {
	}

	/** minimal constructor */
	public Dlluser(String usrcodigo) {
		this.usrcodigo = usrcodigo;
	}

	/** full constructor */
	public Dlluser(String usrcodigo, Bodega bodega, String usrnombre,
			String usrpasswd, String usrperfil, Date usrfecnace,
			Date usrfeccamb, Long usrdiasven, String usrpassint,
			String usrbodega, Long usractivo , String usrbodaut,
			String usrtdcaut, Set<RequiDoc> requiDocs,Dlluser dlluser,Timestamp usrlogfec,
			Set<Mngdoc> mngdocs) {
		this.usrcodigo = usrcodigo;
		this.bodega = bodega;
		this.usrnombre = usrnombre;
		this.usrpasswd = usrpasswd;
		this.usrperfil = usrperfil;
		this.usrfecnace = usrfecnace;
		this.usrfeccamb = usrfeccamb;
		this.usrdiasven = usrdiasven;
		this.usrlogfec = usrlogfec;
		this.dlluser = dlluser;
		this.usrpassint = usrpassint;
		this.usrbodega = usrbodega;
		this.usractivo = usractivo;
		this.usrbodaut = usrbodaut;
		this.usrtdcaut = usrtdcaut;
		this.requiDocs = requiDocs;
		this.mngdocs = mngdocs;	
	}

	// Property accessors
	@Id
	@Column(name = "USRCODIGO", unique = true, nullable = false, insertable = true, updatable = true, length = 15)
	public String getUsrcodigo() {
		return this.usrcodigo;
	}

	public void setUsrcodigo(String usrcodigo) {
		this.usrcodigo = usrcodigo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "USRPREBOD", unique = false, nullable = true, insertable = true, updatable = true)
	public Bodega getBodega() {
		return this.bodega;
	}

	public void setBodega(Bodega bodega) {
		this.bodega = bodega;
	}

	@Column(name = "USRNOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getUsrnombre() {
		return this.usrnombre;
	}

	public void setUsrnombre(String usrnombre) {
		this.usrnombre = usrnombre;
	}

	@Column(name = "USRPASSWD", unique = false, nullable = true, insertable = true, updatable = true, length = 300)
	public String getUsrpasswd() {
		return this.usrpasswd;
	}

	public void setUsrpasswd(String usrpasswd) {
		this.usrpasswd = usrpasswd;
	}

	@Column(name = "USRPERFIL", unique = false, nullable = true, insertable = true, updatable = true, length = 1000)
	public String getUsrperfil() {
		return this.usrperfil;
	}

	public void setUsrperfil(String usrperfil) {
		this.usrperfil = usrperfil;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "USRFECNACE", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getUsrfecnace() {
		return this.usrfecnace;
	}

	public void setUsrfecnace(Date usrfecnace) {
		this.usrfecnace = usrfecnace;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "USRLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "USRLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getUsrlogfec() {
		return this.usrlogfec;
	}

	public void setUsrlogfec(Timestamp usrlogfec) {
		this.usrlogfec = usrlogfec;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "USRFECCAMB", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getUsrfeccamb() {
		return this.usrfeccamb;
	}

	public void setUsrfeccamb(Date usrfeccamb) {
		this.usrfeccamb = usrfeccamb;
	}

	@Column(name = "USRDIASVEN", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getUsrdiasven() {
		return this.usrdiasven;
	}

	public void setUsrdiasven(Long usrdiasven) {
		this.usrdiasven = usrdiasven;
	}

	@Column(name = "USRPASSINT", unique = false, nullable = true, insertable = true, updatable = true, length = 1000)
	public String getUsrpassint() {
		return this.usrpassint;
	}

	public void setUsrpassint(String usrpassint) {
		this.usrpassint = usrpassint;
	}

	@Column(name = "USRBODEGA", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public String getUsrbodega() {
		return this.usrbodega;
	}

	public void setUsrbodega(String usrbodega) {
		this.usrbodega = usrbodega;
	}

	@Column(name = "USRACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getUsractivo() {
		return this.usractivo;
	}

	public void setUsractivo(Long usractivo) {
		this.usractivo = usractivo;
	}
	

	@Column(name = "USRBODAUT", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public String getUsrbodaut() {
		return this.usrbodaut;
	}

	public void setUsrbodaut(String usrbodaut) {
		this.usrbodaut = usrbodaut;
	}

	@Column(name = "USRTDCAUT", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public String getUsrtdcaut() {
		return this.usrtdcaut;
	}

	public void setUsrtdcaut(String usrtdcaut) {
		this.usrtdcaut = usrtdcaut;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "dlluser")
	public Set<RequiDoc> getRequiDocs() {
		return this.requiDocs;
	}

	public void setRequiDocs(Set<RequiDoc> requiDocs) {
		this.requiDocs = requiDocs;
	}

	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "dlluser")
	public Set<Mngdoc> getMngdocs() {
		return this.mngdocs;
	}

	public void setMngdocs(Set<Mngdoc> mngdocs) {
		this.mngdocs = mngdocs;
	}

}